@model CreateAddressViewModel

@{
	ViewBag.Title = Resources.Shared.AppName + " - " + string.Format(Resources.Shared.CreateViewTitle, "Address");
	string twoLettersCulture = new System.Globalization.CultureInfo(Culture).TwoLetterISOLanguageName;	
}

<div class="view-container">
  <div class="view-header-container">
    <h2 class="view-header">@string.Format(Resources.Shared.CreateViewTitle, "Address")</h2>
  </div>
  <!-- Top buttons -->
  <div class="view-button-container top-button-container">
    <input type="button" class="button back-button" title="@Resources.Shared.Back" onclick="CancelChangesAndRedirect('@Url.Action("Index","Address")')"/>
    <input type="button" class="button save-button" title="@Resources.Shared.Save" onclick="$('#AddressForm').submit()"/>	
  </div>
  <!-- Form begin -->
  <div class="entity-form-container">
    @using (Html.BeginForm("Create", "Address", FormMethod.Post, new { id = "AddressForm" })) {
      @Html.ValidationSummary(true)
      <fieldset>
        <legend>@Resources.AddressResources.Address</legend>
		<div class="form">
          @Html.HiddenFor(model => model.Id)
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.AddressLine1)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.AddressLine1)
					@Html.ValidationMessageFor(model => model.AddressLine1)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.AddressLine2)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.AddressLine2)
					@Html.ValidationMessageFor(model => model.AddressLine2)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.City)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.City)
					@Html.ValidationMessageFor(model => model.City)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.StateProvince)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.StateProvince)
					@Html.ValidationMessageFor(model => model.StateProvince)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.PostalCode)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.PostalCode)
					@Html.ValidationMessageFor(model => model.PostalCode)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.Country)
			  	  </div>
				  <div class="editor">
					@Html.TextBoxFor(model => model.Country)
					@Html.ValidationMessageFor(model => model.Country)
				  </div>
				</div>
				<div class="field">
				  <div class="label">
					@Html.Label(Resources.AddressResources.IsBilling)
				  </div>
				  <div class="editor">
					@Html.CheckBoxFor(model => model.IsBilling)
					@Html.ValidationMessageFor(model => model.IsBilling)
				  </div>
				</div>
		    <div class="field">
              <div class="label">
                @Html.Label(Resources.AddressResources.Customer)
              </div>
              <div class="editor">
                @Html.DropDownListFor(model => model.CustomerId, new SelectList(Model.CustomerList, "Id", "IdentityDescription", Model.CustomerId))           
                @Html.ValidationMessageFor(model => model.CustomerId)
              </div>
		    </div>
        </div>
      </fieldset>
    }
    </div>
	<!-- Form end -->
</div>
@section Scripts {
	@Scripts.Render("~/bundles/jqueryval")
	<script src="@Url.Content("~/Scripts/cultures/methods_" + twoLettersCulture + ".js")" type="text/javascript"></script>
<script type="text/javascript">
$(".button").button(); // buttons appereance
</script>
}
